#define _CRT_SECURE_NO_WARNINGS 1
#include<set>
#include<iostream>
using namespace std;
int main()
{
    set<int> bst;
    int n;
    cin >> n;
    while (n--)
    {
        int x;
        cin >> x;
        bst.insert(x);
    }
    cout << bst.size() << endl;
    set<int>::iterator it = bst.begin();
    while (it != bst.end())
    {
        cout << *it << " ";
        it++;
    }
    return 0;
}